#pragma once
#include "JRender.h"
class JGame;
class JPiece;

class JPaneStageDCRender : public JRender
{
public:
	JPaneStageDCRender(JGame* _pGame, CWnd* _pWnd);
	~JPaneStageDCRender();

	void DrawInitGrid(CDC* _pDC);
	void ShowPromptGraph(CDC* _pDC);
	void ShowGraphOrigin(CDC* _pDC);
	void ShowPieces(CDC* _pDC);
	void DrawPiece(CDC* _pDC, JPiece* _pPiece);

private:
	JGame* m_pGame;
	CWnd*	m_pWnd;
	bool	m_bDraging;
	CPoint  m_ptCenterWhenDragStart, m_ptDragStart;
	CRect   m_rcStartDrag;
	//Double Buffer
	CBitmap		m_MemBitmap;
	CDC			m_MemDC;

	void	InvalidatePiece(JPiece* _pPiece);

public:
	static COLORREF g_clrNormalBorder;
	static COLORREF g_clrHotBorder;
	static COLORREF g_clrCurrentBorder;
	static COLORREF g_clrBK;
	static bool		g_showPrompt;
	static float	g_AlphaBendRatio;
public:
	void Show(CDC* _pDC);
	void OnMouseMove(CPoint _pt);
	void OnLButtonDown(CPoint _pt);
	void OnLButtonUp(CPoint _pt);
};

